package cn.design.realize;

import java.math.BigDecimal;

/**
 * @author dlq
 * @description
 * @date 2020/10/15 10:33
 * @since 1.0
 */
public enum FinalPaymentAmountEnum {
    //非会员
    NON{
        @Override
        public BigDecimal calculate(BigDecimal decimal) {
            return decimal.multiply(new BigDecimal("1"));
        }
    },
    //普通会员
    ORDINARY {
        @Override
        public BigDecimal calculate(BigDecimal decimal) {
            return decimal.multiply(new BigDecimal("0.9"));
        }
    },
    //高级会员
    Senior {
        @Override
        public BigDecimal calculate(BigDecimal decimal) {
            return decimal.multiply(new BigDecimal("0.8"));
        }
    };
    
    public  abstract BigDecimal calculate(BigDecimal decimal);
}
